import cv2
import numpy as np
from matplotlib import pyplot as plt

def read():
    img=cv2.imread("cat.JPG");
    numMap={}
    h,w =img.shape
    size=img.size

    #统计出图像中拥有的每个灰度值，以及其出现次数，存储在哈希表numMap中
    for i in range(h):
        for j in range(w):
            if numMap.has_key(img[h,w]):
                numMap[img[h,w]]+=1
            else:
                numMap[img[h,w]]=1

    

